<?php
namespace library\Core;

abstract class Singleton
{

    private static $STATIS_CLASS = array();

    public static function getInstance()
    {
        $className = get_called_class();
        if (!in_array($className, self::$STATIS_CLASS)) {
            self::$STATIS_CLASS[$className] = new $className();
        }
        return self::$STATIS_CLASS[$className];
    }

}
